home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Utilities / System 7 / Control Panels / CntlStrip Patcher 2.0 / ControlStrip.h < prev    next >
Text File  |  1994-07-14  |  4KB  |  161 lines

  1. /*
  2.  *    File:        ControlStrip.h
  3.  *
  4.  *    Abstract:    Interface file for building ControlStrip modules.  The defines
  5.  *                were snagged from the developer's note but the dispatch codes
  6.  *                for the ControlStrip trap were "discovered" using MacsBug.
  7.  *
  8.  *    References:    See the Powerbook 500 series developers note on the
  9.  *                June developer CD.
  10.  *
  11.  *    History:    RSM        94-06-13    Created from scratch.
  12.  *                SA        94-06-29    Added the rest of the dispatch codes.
  13.  *
  14.  *    Author:        Robert S Mah <rmah@panix.com>
  15.  *                Sigurdur Asgeirsson <sigurasg@rhi.hi.is>
  16.  *
  17.  *    ©1994 Me and SA, until Apple Computer, Inc. releases the official file
  18.  */
  19.  
  20. #pragma once
  21. #ifndef __CONTROLSTRIP__
  22. #define __CONTROLSTRIP__
  23.  
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27.  
  28. #ifndef __MENUS__
  29. #include <Menus.h>
  30. #endif
  31.  
  32.  
  33. // Gestalt stuff
  34.  
  35. #define gestaltControlStripAttr        'sdev'    // a bit mask
  36. #define gestaltControlStripExists    0        // bit 0, mask is 0x0001
  37.  
  38. #define gestaltControlStripVersion    'sdvr'    // same as first 4 bytes in 
  39.                                             // a 'vers' resource
  40.  
  41.  
  42. // messages to the 'sdev' code resource
  43.  
  44. enum{
  45.     sdevInitModule = 0,
  46.     sdevCloseModule,
  47.     sdevFeatures,
  48.     sdevGetDisplayWidth,
  49.     sdevPeriodicTickle,
  50.     sdevDrawStatus,
  51.     sdevMouseClick,
  52.     sdevSaveSettings,
  53.     sdevShowBalloonHelp
  54. };
  55.  
  56.  
  57. // return results for sdevFeatures
  58.  
  59. enum{
  60.     sdevWantMouseClicks = (0x01 << 0),
  61.     sdevDontAutoTrack = (0x01 << 1),
  62.     sdevHasCustomHelp = (0x01 << 2),
  63.     sdevKeepModuleLocked = (0x01 << 3)
  64. };
  65.  
  66.  
  67. // return results for sdevPeriodicTickle and sdevMouseClick
  68.  
  69. enum{
  70.     sdevResizeDisplay = (0x01 << 0),
  71.     sdevNeedToSave = (0x01 << 1),
  72.     sdevHelpStateChanged = (0x01 << 2),
  73.     sdevCloseNow = (0x01 << 3)
  74. };
  75.  
  76.  
  77. // Defines for SBDrawBarGraph()
  78.  
  79. #define BarGraphSlopeLeft    -1    // max end of sloping graph is on left
  80. #define BarGraphFlatRight    0    // max end of flat graph is on right
  81. #define BarGraphSlopeRight    1    // max end of sloping graph is on right
  82.  
  83.  
  84. // typedef for control strip procedures
  85.  
  86. pascal long (*ControlStripProcPtr)( long message, 
  87.                                     long params, 
  88.                                     Rect *statusRect, 
  89.                                     GrafPtr statusPort );
  90.  
  91.  
  92. #if __cplusplus
  93. extern "C" {
  94. #endif
  95.  
  96. pascal Boolean 
  97. SBControlStripVisible( void )
  98.         = { 0x303C, 0x0000, 0xAAF2 };
  99.  
  100. pascal Boolean 
  101. SBShowHideControlStrip( Boolean showIt )
  102.         = { 0x303C, 0x0101, 0xAAF2 };
  103.  
  104. pascal Boolean
  105. SBSafeToAccessStartupDisk( void )
  106.          = { 0x303C, 0x0002, 0xAAF2 };
  107.  
  108. pascal short 
  109. SBOpenModuleResourceFile( OSType fileCreator )
  110.          = { 0x303C, 0x0203, 0xAAF2 };
  111.  
  112. pascal OSErr 
  113. SBLoadPreferences( ConstStr255Param rsrcName, Handle *prefsH )
  114.          = { 0x303C, 0x0404, 0xAAF2 };
  115.  
  116. pascal OSErr 
  117. SBSavePreferences( ConstStr255Param rsrcName, Handle prefsH )
  118.          = { 0x303C, 0x0405, 0xAAF2 };
  119.  
  120. pascal short 
  121. SBGetDetachedIndString( StringPtr dst, Handle strH, short idx )
  122.         = { 0x303C, 0x0506, 0xAAF2 };
  123.  
  124. pascal OSErr 
  125. SBGetDetachIconSuite( Handle *suiteH, short resID, unsigned long )
  126.          = { 0x303C, 0x0507, 0xAAF2 };
  127.  
  128. pascal short 
  129. SBTrackPopupMenu( const Rect *moduleRect, MenuHandle )
  130.         = { 0x303C, 0x0408, 0xAAF2 };
  131.  
  132. pascal short 
  133. SBTrackSlider( const Rect*, short nTicks, short initVal )
  134.          = { 0x303C, 0x0409, 0xAAF2 };
  135.  
  136. pascal OSErr 
  137. SBShowHelpString( const Rect*, StringPtr helpStr )
  138.          = { 0x303C, 0x040A, 0xAAF2 };
  139.  
  140. pascal short 
  141. SBGetBarGraphWidth( short barCount )
  142.          = { 0x303C, 0x010B, 0xAAF2 };
  143.  
  144. pascal void 
  145. SBDrawBarGraph( short level, short barCount, short direction, Point topLeft )
  146.          = { 0x303C, 0x050C, 0xAAF2 };
  147.  
  148. pascal short 
  149. SBModalDialogInContext( ModalFilterProcPtr, short *item )
  150.          = { 0x303C, 0x040D, 0xAAF2 };
  151.  
  152.  
  153.  
  154. #if __cplusplus
  155. }
  156. #endif
  157.  
  158.  
  159. #endif
  160.  
  161.